package com.defect.controller.statistics;

import com.defect.bo.ResultBo;
import com.defect.service.statisticsService.STypeService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;

@RestController
@RequestMapping("type")
public class STypeController {
    @Resource
    private STypeService typeService;

    /**
     * 带条件查询每一种缺陷有多少条数据
     * @param id 项目id
     * @param date1 开始时间
     * @param date2 最后时间
     * @return 返回集合,count1属性为数据条数，TypeDesc为缺陷类型名称
     * @throws Exception
     */
    @RequestMapping("count")
    public ResultBo selectType(Integer id, Date date1, Date date2) throws Exception {
        return new ResultBo("200", "success", null, typeService.selectTypeCount(id,date1,date2));
    }
}
